From 3baee98422887ad86001fb476df62e0a0ad33d39 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Sun, 18 Mar 2007 18:26:34 +0000 Subject: [PATCH] xend: Avoid use of 'k' specifier to Py_BuildValue(). Its implementation is broken until Python v2.4.3. Instead cast the C value to long long and use the 'L' specifier. Signed-off-by: Keir Fraser --- tools/python/xen/lowlevel/xc/xc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index 894ff7777c..e3b3d4c0e6 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -314,7 +314,7 @@ static PyObject *pyxc_domain_getinfo(XcObject *self, { info_dict = Py_BuildValue( "{s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i" - ",s:k,s:L,s:k,s:i,s:i}", + ",s:L,s:L,s:L,s:i,s:i}", "domid", (int)info[i].domid, "online_vcpus", info[i].nr_online_vcpus, "max_vcpu_id", info[i].max_vcpu_id, @@ -325,9 +325,9 @@ static PyObject *pyxc_domain_getinfo(XcObject *self, "paused", info[i].paused, "blocked", info[i].blocked, "running", info[i].running, - "mem_kb", info[i].nr_pages*(XC_PAGE_SIZE/1024), + "mem_kb", (long long)info[i].nr_pages*(XC_PAGE_SIZE/1024), "cpu_time", (long long)info[i].cpu_time, - "maxmem_kb", info[i].max_memkb, + "maxmem_kb", (long long)info[i].max_memkb, "ssidref", (int)info[i].ssidref, "shutdown_reason", info[i].shutdown_reason); pyhandle = PyList_New(sizeof(xen_domain_handle_t)); -- 2.30.2